
\subsection{Costing Model}

There are innumerable issues and associated parameters which impinge
on total network installation and running cost. We therefore need to
``keep out wits about us'' in order to keep all significant aspects
of costs firmly  in view and properly accounted for.

Firstly: we confine ourselves to running cost. In so far as installation
cost is a consideration we assume that it can be viewed as distributed
over time in the manner of rent. Let us say no more about it.

Secondly: all costs will be viewed in proportion to each successfully delivered
packet. This is not at all the only logical way to view running cost, but
it is no worse than cost per byte, cost per bit, or cost per flow, and it is
superior to a mixture of two or more of these approaches on account of the
the clarity which is therefore established. Thus, transmission cost, switching
cost and flow setup cost, in every layer, must be measured in this same
unit of cost per packet. This is in some cases a difficult task -- for example,
transmission cost is really better allocated per byte or per bit, but
we stick to insisting that it is measured per packet. This means that
bytes per packet will be an important parameter for us, and we might need
to assign different values to this parameter, depending on the particular
traffic stream.

In the case of flow-setup cost we do not expect the user to supply this value
in the form of cost-per-byte, even though a conversion to cost-per-byte can be
undertaken if the size of the flows is known. This conversion will take place
inside the software. This is because whether or not a flow need to be setup
depends on the particular path the flow follows, and asking the user to
supply the flow setup cost as a cost per packet might give the false impression
that it will be {\em assumed} that flows are setup.

Users are expected to supply only {\em some} of the cost-per-packet parameters
which are used in calculating total network running cost, with others
{\em inferred} from other parameters. Table \ref{costperpkt} lists
all costing parameters, including whether they are supplied or calculated,
and in the latter case, how the calculation is carried out.

\begin{table}
\begin{center} \caption{Costing Parameters}\label{costperpkt}
\begin{tabular}{|l|p{2cm}|p{2cm}|p{2cm}|p{2cm}|}
\hline
\bf Name&\bf Description&\bf Supplied?&\bf How calculated&\bf Where calculated\\
\hline
\tt pktswcost&Cost of switching expressed per packet in layer $n$&Y&& \\
\tt pkttranscost&Cost of transmission per packet in layer $n$&Y -- for Layer 0; N -- for higher layers&For layers above 0, the cost of using a link is calculated
as the sum of the cost of the lower layer links used, for each flow size separately&Raw costs of Layer 0 links are accessed via NetLink::get\-TransCost() and NetLink::get\-PerPktCost(); higher layer links have costs stored by means of NetLink::setCost(); this method is called only by network::calcRoutes()\\
\tt pkttransdistcost&Cost of transmission per packet per Km in layer $n$&Y --
for Layer 0; for higher layers this cost is $0$ (since {\tt pkttranscost} varies from one
link to another anyway)&& \\
\tt flowsetupcost&Flow setup cost per flow in layer $n$&Y&& \\
\tt flowsetupcostperpkt&Flow setup cost per packet in layer $n$&N&{\tt flowsetupcost}
is divided by the average flow size, for the flows of a particular size category on this particular link&NetLink::get\-PerPktCost()\\
\hline
\end{tabular}
\end{center}
\end{table}

\subsection{Implementation of Costing}

Implementing the costing formulae in the netml software needs
to be validated. For this purpose a table of the
separate {\em costing functions} in the software has
been prepared, including a description of this function,
the location in the software where this function
is implemented, a description of a validity test, including
the name of the XML files used in the tests, and, finally,
a column recording when the test was passed. See Table \ref{costtable}.

In our routing model, all packets choose the least cost
path, just as in the current Internet, There is a difference between
the model discussed here and the Internet, however, which is that
in the present case the per-packet cost of a link might (and usually will)
be different for different sizes of flow. If we can verify that the
per-packet costs for each link and each path are as the should be
we will have completed at least half the validation of costing.



\begin{table}
\begin{center}
\caption{Tests of Costing}\label{costtable}
\begin{tabular}{|p{3cm}|p{4cm}|p{3cm}|r|}
\hline
\bf Description of function&\bf Location&\bf Description of test&\bf Date passed\\
\hline
Cost of layer $n$ switching&NetLink::getPerPktCost, NetLink::getSwCost(),
NetLink::getFlowCost()&Increase traffic rate uniformly, and module sizes
at the same rate -- cost should increase linearly with traffic rate&
\\
Cost of layer $n$ switching&NetLink::getPerPktCost, NetLink::getSwCost(),
NetLink::getFlowCost()&Increase cost of switching and observe that the cost of
this type of switching increases appropriately& \\
Cost of layer $n$ transmission&NetLink::getTransCost()&Increase cost of transmission and observe that
the increase in transmission cost is as expected& \\
Cost of layer $n$ flow-setup costs&NetLink::getFlowCost()&Increase cost of flow setup in layer $n$ and observe that the increase in transmission cost is as expected& \\
Layer $n$ utilization is taken into account in the cost of
packet delivery [for which layer?]&NetLink::setCost()&Change the flow rates by a small amount and observe that costs
increase in a manner appropriate to the utilisation of fixed capacity paths
appropriately& \\
\hline
\end{tabular}
\end{center}
\end{table}

\subsection{How to Model Real Networks}

The layered model described above is excellent for guiding software design, however
in order to use this model for real network design we need to be able to map
the costs of typical network equipment, like add-drop multiplexors, routers,
optical add-drop multiplexors, optical burst switching equipment, laser diodes,
optical amplifiers, and so on, to the cost parameters of a particular layer.
This mapping is set out in Table \ref{realequipmentcosts}.

\begin{table}
\begin{center}
\caption{Cost parameters for real network
equipment}\label{realequipmentcosts}
\begin{tabular}{|p{5cm}|p{5cm}|}
\hline
\bf Item&\bf Layered Model parameters\\
\hline
IP routing cost&{\tt pktswcost} at the top (IP) layer (Note: at other layers
{\tt pktswcost} should be zero)\\
Optical Add-drop multiplexor&Flow setup cost in the layer where wavelength paths are set up\\
SDH Add-drop multiplexor&Flow setup cost in the layer where SDH paths are set up\\
Cost of optical fibers&{\tt pkttranscost} and {\tt pkttransdistcost} at Layer $0$
(Note: at other layers {\tt pkttranscost} and {\tt pkttransdistcost} should be zero)\\
Cost of setting up an OBS burst&Flow setup cost in the layer where OBS bursts are set up\\
\dots&\dots\\
\hline
\end{tabular}
\end{center}
\end{table}
